//
//  DSSHMeBlackRecordVC.m
//  DSSH
//
//  Created by lcy on 16/4/1.
//  Copyright © 2016年 lcy. All rights reserved.
//

#import "DSSHMeBlackRecordVC.h"
#import "MeBlackRecordCell.h"
#import "DSSHBlackRecordDetailVC.h"
@interface DSSHMeBlackRecordVC ()<UITableViewDataSource,UITableViewDelegate>
@property(nonatomic,strong)UITableView*recordTableView;
@end

@implementation DSSHMeBlackRecordVC

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupViewAndData];
    // Do any additional setup after loading the view.
}
-(void)setupViewAndData
{
    self.title = @"黑点记录";
    self.view.backgroundColor = [UIColor whiteColor];
    self.recordTableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStylePlain];
    self.recordTableView.delegate = self;
    self.recordTableView.dataSource = self;
    self.recordTableView.tableFooterView = [[UIView alloc]init];
    [self.view addSubview:self.recordTableView];
    
    UIBarButtonItem * backBarBtn = [[UIBarButtonItem alloc]initWithImage:[UIImage imageNamed:@"fanhui"] style:UIBarButtonItemStylePlain target:self action:@selector(backBarBtnClick)];
    self.navigationItem.leftBarButtonItem = backBarBtn;
    
    UIBarButtonItem * rightBarBtn = [[UIBarButtonItem alloc]initWithTitle:@"申请解除" style:UIBarButtonItemStylePlain target:self action:@selector(submitBtnClick)];
    self.navigationItem.rightBarButtonItem = rightBarBtn;
}
-(void)backBarBtnClick
{
    [self.navigationController popViewControllerAnimated:YES];
}
-(void)submitBtnClick
{
    
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 6;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString* cellID = @"cellID";
    MeBlackRecordCell * cell = [tableView dequeueReusableCellWithIdentifier:cellID];
    if (!cell)
    {
        cell = [[NSBundle mainBundle]loadNibNamed:@"MeBlackRecordCell" owner:nil options:nil][0];
    }
    return cell;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 60;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    DSSHBlackRecordDetailVC * detailVC = [[DSSHBlackRecordDetailVC alloc]init];
    [self.navigationController pushViewController:detailVC animated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
